//<template>
    <div>
        <div>
            <tr>
                <td>订单名</td>
                <td>订单价格</td>
                <td>图片</td>
                <td>用户</td>
                <td>评价</td>
            </tr>
            <tr v-for="i in order_list" :key="i.id">
                <td>{{i.order_name}}</td>
                <td>{{i.order_price}}</td>
                <td><img :src="url+i.order_img" alt=""></td>
                <td>{{i.user.name}}</td>
                <td><button @click="toEstimate(i.id)">评价</button></td>
            </tr>
        </div>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data(){
        return{
            order_list:[],
            id:sessionStorage.getItem('user_id'),
            url:'http://127.0.0.1:8000'
        }
    },
    methods:{
        orderShow(){
            axios({
                url:'http://127.0.0.1:8000/app02/order_show/',
                method:'get',
                params:{id:this.id}
            }).then(res=>{
                this.order_list = res.data
            })
        },
        toEstimate(id){
            this.$router.push({path:'/estimateh/'+id})
        }
    },
    created(){
        this.orderShow()
    }
}
</script>

<style>

</style>